from selenium import webdriver
from selenium.webdriver.common.by import By

url = 'https://zhidao.baidu.com/question/1952259230876274508.html'
driver = webdriver.Chrome()
driver.get(url)

# 切换到frame内部的HTML
driver.switch_to.frame(0)
# 定位frame内部的元素
driver.find_element(By.XPATH, '/html/boday').send_keys('Python')
# 跳回到网页的HTML
driver.switch_to.default_content()
# 单击提交回答按钮
driver.find_element(By.XPATH, '//*[@id="answer-editor"]/div[2]/a').click()
